#ifndef PLAYER_H_INCLUDED
#define PLAYER_H_INCLUDED

#include <vector>

#include "entity.h"
#include "skill.h"


// TODO: set skill descriptions

class Skill;

class Monster;

class Player : public Entity
{
public:
    Player(const std::string& _name, const int& _health, const int& _attack, const int& _defense, const int& _speed);
    ~Player();

    virtual void writeInfo() const = 0;
    void writeStats() const;
    void setEnemy(Monster* _enemy) { enemy = _enemy; }
    Monster* getEnemy() const { return enemy; }
    void startCombat();
    virtual void classStart() = 0;
    void saveStats(std::ostream& outfile) const;

    int getLevel() const { return level; }
    int getExperience() const { return experience; }
    int getCooldown(const int& i) const { return skills[i]->getCooldown(); }
    std::string getSkillName(const int& i) const { return skills[i]->getName(); }
    int getID() const { return classID; }

    virtual void useSkill(const int& i);
    void gainExperience(const int& exp);
    virtual void levelup();
protected:
    int classID;
    int level;
    int experience;
    std::vector<Skill*> skills;
    Monster* enemy;
};

class Rogue : public Player
{
public:
    Rogue(const std::string& _name);

    void writeInfo() const;

    void classStart() {}
    void useSkill(const int& i);

    void levelup();
};

class Mage : public Player
{
public:
    Mage(const std::string& _name);

    void writeInfo() const;

    void classStart() {}

    void levelup();
};

class Warrior : public Player
{
public:
    Warrior(const std::string& _name);

    void writeInfo() const;

    void classStart() { hasbonus = false; }
    void useSkill(const int& i);

    void levelup();

private:
    bool hasbonus;
};

#endif // PLAYER_H_INCLUDED
